<template>
  <div>
    <el-table :data="ScheInfo" style="width: 100%">
      <el-table-column prop="ScheInfo.StartTime" label="开始时间" :formatter="formatDate"></el-table-column>
      <el-table-column prop="ScheInfo.overTime" :formatter="formatDate" label="结束时间"></el-table-column>
      <el-table-column prop="HallType" label="影厅"></el-table-column>
      <el-table-column prop="ScheInfo.Price" label="价格"></el-table-column>
      <el-table-column label="购票">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="danger"
            @click="drawer=true;id=+new Date();handleClick(scope.row)"
          >购票</el-button>
        </template>
      </el-table-column>
    </el-table>
    <el-drawer
      title="选座"
      :with-header="false"
      :append-to-body="true"
      direction="btt"
      size="60%"
      style="width:40%;left:60%"
      :visible.sync="drawer"
    >
      <seat :key="id" :Schedule="HallSche"></seat>
    </el-drawer>
  </div>
</template>
<script>
import Seat from "@/views/Seat";
export default {
  components: {
    Seat
  },
  data() {
    return {
      HallSche:null,
      drawer: false,
      ScheInfo: null,
      id: +new Date()
    };
  },
  mounted() {
    this.ScheInfo = this.$store.state.ScheInfo;
    
  },
  methods: {
    handleClick(row) {
      this.HallSche=row
    },
    formatDate(row, column, cellValue, index) {
      // 获取单元格数据
      let dt = cellValue.substring(11, 16);
      return dt;
    }
    
  }
};
</script>